doctype html

div.wrapper(
    tg-project-modules
    ng-controller="ProjectProfileController as ctrl"
    ng-init="section='admin'; sectionName='ADMIN.MODULES.TITLE'"
)
    tg-project-menu
    sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="project-profile")
        include ../includes/modules/admin-menu

    sidebar.menu-tertiary.sidebar(tg-admin-navigation="modules")
        include ../includes/modules/admin-submenu-project-profile

    section.main.admin-functionalities
        header
            include ../includes/components/mainTitle

        form.module-container
            .module.module-epics(ng-class="{true:'active', false:''}[project.is_epics_activated]")
                .module-icon
                    tg-svg(svg-icon="icon-epics")
                .module-name(translate="ADMIN.MODULES.EPICS")
                .module-desc
                    p(translate="ADMIN.MODULES.EPICS_DESCRIPTION")
                .module-activation.module-direct-active
                    div.check
                        input.activate-input(
                            id="functionality-epics"
                            name="functionality-epics"
                            type="checkbox"
                            ng-checked="project.is_epics_activated"
                            ng-model="project.is_epics_activated"
                        )
                        div
                        span.check-text.check-yes(translate="COMMON.YES")
                        span.check-text.check-no(translate="COMMON.NO")
            .module.module-scrum(ng-class="{true:'active', false:''}[project.is_backlog_activated]")
                .module-icon
                    tg-svg(svg-icon="icon-scrum")
                .module-name(translate="ADMIN.MODULES.BACKLOG")
                .module-desc
                    p(translate="ADMIN.MODULES.BACKLOG_DESCRIPTION")                    
                    .module-desc-options(ng-if="project.is_backlog_activated")
                        fieldset
                            label(for="total-sprints") {{ 'ADMIN.MODULES.NUMBER_SPRINTS' | translate }}
                            input(
                                id="total-sprints"
                                name="total-sprints"
                                type="number"
                                min="0"
                                placeholder="{{'ADMIN.MODULES.NUMBER_SPRINTS_HELP' | translate}}"
                                ng-model="project.total_milestones"
                                data-type="digits"
                            )

                        fieldset
                            label(for="total-story-points") {{ 'ADMIN.MODULES.NUMBER_US_POINTS' | translate }}
                            input(
                                id="total-story-points"
                                name="total-story-points"
                                type="number"
                                min="0"
                                placeholder="{{'ADMIN.MODULES.NUMBER_US_POINTS_HELP' | translate}}"
                                ng-model="project.total_story_points"
                                data-type="digits"
                             )
                        .options
                            a.save(href="", ng-if="project.is_backlog_activated")
                                tg-svg(svg-icon="icon-save")
                .module-activation.module-direct-active
                    div.check
                        input.activate-input(
                            id="functionality-backlog"
                            name="functionality-backlog"
                            type="checkbox"
                            ng-checked="project.is_backlog_activated"
                            ng-model="project.is_backlog_activated"
                        )
                        div
                        span.check-text.check-yes(translate="COMMON.YES")
                        span.check-text.check-no(translate="COMMON.NO")

            .module.module-kanban(ng-class="{true:'active', false:''}[project.is_kanban_activated]")
                .module-icon
                    tg-svg(svg-icon="icon-kanban")
                .module-name(translate="ADMIN.MODULES.KANBAN")
                .module-desc(translate="ADMIN.MODULES.KANBAN_DESCRIPTION")
                .module-activation.module-direct-active
                    div.check
                        input.activate-input(
                            id="functionality-kanban"
                            name="functionality-kanban"
                            type="checkbox"
                            ng-checked="project.is_kanban_activated"
                            ng-model="project.is_kanban_activated"
                        )
                        div
                        span.check-text.check-yes(translate="COMMON.YES")
                        span.check-text.check-no(translate="COMMON.NO")

            .module.module-issues(ng-class="{true:'active', false:''}[project.is_issues_activated]")
                .module-icon
                    tg-svg(svg-icon="icon-issues")
                .module-name(translate="ADMIN.MODULES.ISSUES")
                .module-desc(translate="ADMIN.MODULES.ISSUES_DESCRIPTION")
                .module-activation.module-direct-active
                    div.check
                        input.activate-input(
                            id="functionality-issues"
                            name="functionality-issues"
                            type="checkbox"
                            ng-checked="project.is_issues_activated"
                            ng-model="project.is_issues_activated"
                        )
                        div
                        span.check-text.check-yes(translate="COMMON.YES")
                        span.check-text.check-no(translate="COMMON.NO")

            .module.module-wiki(ng-class="{true:'active', false:''}[project.is_wiki_activated]")
                .module-icon
                    tg-svg(svg-icon="icon-wiki")
                .module-name(translate="ADMIN.MODULES.WIKI")
                .module-desc(translate="ADMIN.MODULES.WIKI_DESCRIPTION")
                .module-activation.module-direct-active
                    div.check
                        input.activate-input(
                            id="functionality-wiki"
                            name="functionality-wiki"
                            type="checkbox"
                            ng-checked="project.is_wiki_activated"
                            ng-model="project.is_wiki_activated"
                        )
                        div
                        span.check-text.check-yes(translate="COMMON.YES")
                        span.check-text.check-no(translate="COMMON.NO")

            .module.module-videoconference(ng-class="{true:'active', false:''}[isVideoconferenceActivated]")
                .module-icon
                    tg-svg(svg-icon="icon-meetup")
                .module-name(translate="ADMIN.MODULES.MEETUP")
                .module-desc
                    p(translate="ADMIN.MODULES.MEETUP_DESCRIPTION")
                    div.videoconference-attributes(ng-if="isVideoconferenceActivated")
                        select(
                            id="videoconference-type"
                            name="videoconference-type"
                            ng-model="project.videoconferences"
                            ng-options="e.id as e.name|translate for e in [{'id':'whereby-com', 'name':'ADMIN.MODULES.WHEREBYCOM_CHAT_ROOM'},{'id':'jitsi', 'name': 'ADMIN.MODULES.JITSI_CHAT_ROOM'},{'id':'talky', 'name': 'ADMIN.MODULES.TALKY_CHAT_ROOM'},{'id':'custom', 'name': 'ADMIN.MODULES.CUSTOM_CHAT_ROOM'}]")
                            option(
                                value=""
                                translate="ADMIN.MODULES.SELECT_VIDEOCONFERENCE"
                            )
                        fieldset(ng-if="project.videoconferences && project.videoconferences != 'custom'")
                            input(
                                id="videoconference-prefix"
                                name="videoconference-prefix"
                                type="text"
                                ng-model="project.videoconferences_extra_data"
                                data-maxlength="250"
                                placeholder="{{'ADMIN.MODULES.SALT_CHAT_ROOM' | translate}}"
                            )
                        fieldset(ng-if="project.videoconferences == 'custom'")
                            input(
                                id="videoconference-url"
                                name="videoconference-url"
                                type="text"
                                ng-model="project.videoconferences_extra_data"
                                data-maxlength="250"
                                placeholder="{{'ADMIN.MODULES.URL_CHAT_ROOM' | translate}}"
                                data-url
                                data-required="true"
                            )
                        fieldset.options
                            a.save(href="", ng-if="project.videoconferences")
                                tg-svg(svg-icon="icon-save")

                .module-activation
                    div.check
                        input.activate-input(
                            id="functionality-video"
                            name="functionality-video"
                            type="checkbox"
                            ng-checked="project.isVideoconferenceActivated"
                            ng-model="isVideoconferenceActivated"
                        )
                        div
                        span.check-text.check-yes(translate="COMMON.YES")
                        span.check-text.check-no(translate="COMMON.NO")
